﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="GroupMessageControl.ascx.cs"
    Inherits="CARMS.Controls.GroupMessageControl" %>
<%@ Import Namespace="CARMSBusiness.InterFace" %>
<table cellpadding="5">
    <tr>
        <td>
            <asp:Label ID="Label1" runat="server" SkinID="LabelTitle" Text="Latest 5 Group Message"></asp:Label>
        </td>
        <td align="right">
            <asp:HyperLink ID="HyperLink1" runat="server" SkinID="LinkBold" Text="View All Message(s)" NavigateUrl="~/Message/MessageList.aspx?ActiveTab=2"></asp:HyperLink>
        </td>
    </tr>
   <tr>
    <td colspan="2">
  
    <vs:GridView ID="gridList" runat="server" AutoGenerateColumns="False" AllowSorting="True"
        OnRowDataBound="gridList_RowDataBound" OnRowCommand="gridList_OnRowCommand">
        <Columns>
            <vs:TemplateField HeaderText="Reference No." ItemStyle-Width="100px"  >
                <ItemTemplate>
                    <div style="width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap"
                        >
                        <asp:Label runat="server" ID="lblJobNumber"></asp:Label>
                       
                    </div>
                </ItemTemplate>
            </vs:TemplateField>
            <vs:TemplateField HeaderText="Message Title" ItemStyle-Width="160px">
                <ItemTemplate>
                    <div style="width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap"
                        title='<%#Eval("Title")%>'>
                         <asp:LinkButton runat="server" ID="LinkButton1" Text='<%#Eval("Title")%>' CommandName="ViewItem"
                        CommandArgument='<%#Eval("MessageID") %>' />
                    </div>
                </ItemTemplate>
            </vs:TemplateField>
                 <vs:TemplateField HeaderText="Create Date" ItemStyle-Width="130px">
                <ItemTemplate>
                    <div style="width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap"
                        title='<%#((DateTime)Eval("CreateDate")).ToString(ApplicationConfiguration.DateTimeFormat)%>'>
                       <%#((DateTime)Eval("CreateDate")).ToString(ApplicationConfiguration.DateTimeFormat)%>
                    </div>
                </ItemTemplate>
            </vs:TemplateField>
            
            <vs:TemplateField HeaderText="Operation" ItemStyle-Width="120px">
                <ItemTemplate>
                    <asp:LinkButton runat="server" ID="LinkButton21" Text="Pick Up" CommandName="PickUp"
                        CommandArgument='<%#Eval("MessageID") %>' />
                    <asp:LinkButton runat="server" ID="btnDelete" Text="Delete" CommandName="DeleteItem" style="margin-left:20px;"
                        CommandArgument='<%#Eval("MessageID") %>' OnClientClick="return ConfirmDeleteScript();" />
                </ItemTemplate>
            </vs:TemplateField>
        </Columns>
    </vs:GridView>
  
    </td>
   </tr></table>